﻿using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;

namespace EFCoreDemo2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            using(var db= new SqlDbContext())
            {
                var student = new Entity.Student() { Name = "lyf", Age = 18, Address = "JiaLuHeRoad" };
                db.Students.Add(student);
                db.SaveChanges();

                var query = db.Students.Where(p => p.Name == "lyf").FirstOrDefault();
                //Console.WriteLine(query.ToQueryString());
                Console.WriteLine(query.Name);
                Console.ReadKey();
            }
        }
    }
}